home *** CD-ROM | disk | FTP | other *** search
- On 03-Okt-97, Peter Falkesand smashed the keyboard with:
- >Hi!
-
- >Is there a smooth way to sort 20 variables???
- >and not do like this..
-
- >--------------------------------
-
- >If score1_1(1)>score2_1(1)
-
- >Loke S7+40,Leek(S5+20)
-
- >endif
-
- >if score1_2(2)>score2_1(1)
-
- >loke s7+60,leek(s5+40)
-
- >endif
-
- >-------------------------------
- *sigh*, that's BIG
-
- >This way makes the program very big..!
- >Any soloution anyone????
-
- This is from memory, so might not be perfect:
-
- L=$7FFFFFFF
- For A=1 to 20
- T=-1 : SN=-1
- For B=2 to 20
- If SCORE(B)>T and SCORE(B)<L
- T=SCORE(B) : SN=B
- Endif
- Next B
- If SN>-1
- 'SN will hold the index-number of the score
- 'Put is down where you'd like it to be
- 'A holds the rating of the score (1=High, 20=Low)
- Else
- Exit
- Endif
- L=T
- Next A
-
- NOTE: This won't handle two equal scores (I'll lose one of 'em), but that
- should not be so hard to handle (Let me know if you got problems with it)
-
- --
- Happy greetings, Yours..
- __________________________________________________________________________
- /_ __/ __ / __ /\ ___\ __ \__ _\ aka. JENS VANG PETERSEN
- / / / /_/ / ____/ \ \___\ __ \ \ \ Nyvej 8, DK-4450 Jyderup, Denmark
- /_/ /_____/_/ \_____\_\ \_\ \_\ top_cat@post8.tele.dk
- --------------------------------------------------------------------------
- Never forget the 'Queen Of Hearts', Diana, Princess Of Wales, 1961->1997
- --------------------------------------------------------------------------
-
-
-